﻿//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Text.RegularExpressions;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmThemNhanVien : Form
	
	{
		
		#region Fields
			private Button btThem;
			private Button btThoat;
			private ComboBox cbChucVu;
			private Container components;
			private string connStr;
			private Database_Com db;
			private DateTimePicker dtpBirthDay;
			public int flag;
			private Label label1;
			private Label label10;
			private Label label11;
			private Label label12;
			private Label label2;
			private Label label3;
			private Label label4;
			private Label label5;
			private Label label6;
			private Label label7;
			private Label label8;
			private Label label9;
			private RadioButton rbFemale;
			private RadioButton rbMale;
			private TextBox tbAddress;
			private TextBox tbAge;
			private TextBox tbChuyenMon;
			private TextBox tbDiDong;
			private TextBox tbEmail;
			private TextBox tbFullName;
			private TextBox tbID;
			private TextBox tbPhone;
		#endregion
		
		#region Constructors
		
			public frmThemNhanVien ()
			
			{
				this.components = ((System.ComponentModel.Container) null);
				this.db = new Database_Com ();
				this.flag = 1;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btThem_Click (object sender, EventArgs e)
			
			{
				string theString;
				string theString2;
				string theString3;
				Exception theException;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (! this.checkData ())
				{
					goto L_03A1;
				}
				if (this.tbPhone.Text.Length <= 0)
				{
					goto L_004E;
				}
				if (this.IsNumber (this.tbPhone.Text.ToString ()))
				{
					goto L_004E;
				}
                DialogResult theDialogResult = MessageBox.Show("Số điện thoại không hợp lệ", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_03A1;
				
			L_004E:
				
				{
				}
				if (this.tbDiDong.Text.Length <= 0)
				{
					goto L_0091;
				}
				if (this.IsNumber (this.tbDiDong.Text.ToString ()))
				{
					goto L_0091;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Số điện thoại di động không hợp lệ", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_03A1;
				
			L_0091:
				
				{
				}
				if (this.tbEmail.Text.Length <= 0)
				{
					goto L_00D3;
				}
				if (Regex.IsMatch (this.tbEmail.Text, "^([\\w-]+\\.)*?[\\w-]+@[\\w-]+\\.([\\w-]+\\.)*?[\\w]+$"))
				{
					goto L_00D3;
				}
                DialogResult theDialogResult3 = MessageBox.Show("Địa chỉ E-Mail không hợp lệ!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_03A1;
				
			L_00D3:
				
				{
				}
				if (this.tbDiDong.Text != "")
				{
					goto L_00F2;
				}
				theString2 = "0";
				goto L_0103;
				
			L_00F2:
				
				{
				}
				theString2 = this.tbDiDong.Text.ToString ();
				
			L_0103:
				
				{
				}
				if (this.tbEmail.Text != "")
				{
					goto L_0122;
				}
				theString3 = "";
				goto L_0133;
				
			L_0122:
				
				{
				}
				theString3 = this.tbEmail.Text.ToString ();
				
			L_0133:
				
				{
				}
				if (! this.rbMale.Checked)
				{
					goto L_0148;
				}
				theString = "Nam";
				goto L_014E;
				
			L_0148:
				
				{
				}
				theString = "Nữ";
				
			L_014E:
				try
				{
					this.dtpBirthDay.CustomFormat = "MM/dd/yyyy";
					this.LoadID ();
					SqlConnection theSqlConnection = this.db.CreateConnections ();
					theStringArray = new string[11];
					theStringArray[0] = "@empID";
					theStringArray[1] = "@empName";
					theStringArray[2] = "@empBirthDate";
					theStringArray[3] = "@empAge";
					theStringArray[4] = "@empSex";
					theStringArray[5] = "@empPosition";
					theStringArray[6] = "@empSpecialize";
					theStringArray[7] = "@empAddress";
					theStringArray[8] = "@empTel";
					theStringArray[9] = "@empMobile";
					theStringArray[10] = "@empEmail";
					theSqlDbTypeArray = new SqlDbType[11];
					theSqlDbTypeArray[0] = SqlDbType.VarChar;
					theSqlDbTypeArray[1] = SqlDbType.NVarChar;
					theSqlDbTypeArray[2] = SqlDbType.DateTime;
					theSqlDbTypeArray[3] = SqlDbType.TinyInt;
					theSqlDbTypeArray[4] = SqlDbType.NVarChar;
					theSqlDbTypeArray[5] = SqlDbType.NVarChar;
					theSqlDbTypeArray[6] = SqlDbType.NVarChar;
					theSqlDbTypeArray[7] = SqlDbType.NVarChar;
					theSqlDbTypeArray[8] = SqlDbType.NVarChar;
					theSqlDbTypeArray[9] = SqlDbType.NVarChar;
					theSqlDbTypeArray[10] = SqlDbType.VarChar;
					theObjectArray = new object[11];
					theObjectArray[0] = this.tbID.Text.ToString ();
					theObjectArray[1] = this.tbFullName.Text.ToString ();
					theObjectArray[2] = this.dtpBirthDay.Text;
					theObjectArray[3] = this.tbAge.Text.ToString ();
					theObjectArray[4] = theString;
					theObjectArray[5] = this.cbChucVu.Text.ToString ();
					theObjectArray[6] = this.tbChuyenMon.Text.ToString ();
					theObjectArray[7] = this.tbAddress.Text.ToString ();
					theObjectArray[8] = this.tbPhone.Text.ToString ();
					theObjectArray[9] = theString2;
					theObjectArray[10] = theString3;
					this.db.ExecuteStoredProc ("sp_Employees_Insert", theStringArray, theSqlDbTypeArray, theObjectArray);
					this.frmThemNhanVien_Load (sender, e);
                    DialogResult theDialogResult4 = MessageBox.Show("Thêm mới thành công!", "Thêm mới thành công!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.tbFullName.Text = "";
					this.tbAge.Text = "";
					this.tbChuyenMon.Text = "";
					this.tbAddress.Text = "";
					this.tbPhone.Text = "";
					this.tbDiDong.Text = "";
					this.tbEmail.Text = "";
					this.dtpBirthDay.CustomFormat = "dd/MM/yyyy";
				}
				catch (Exception theException2)
				{
					
				L_0392:
					theException = theException2;
					DialogResult theDialogResult5 = MessageBox.Show (theException.Message);
				}
				
			L_03A1:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private bool checkData ()
			
			{
				bool theBoolean;
				if (this.tbFullName.Text != "")
				{
					goto L_0031;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng nhập tên nhân viên!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_0031:
				
				{
				}
				if (this.tbAge.Text != "")
				{
					goto L_0062;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui lòng nhập ngày sinh!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_0062:
				
				{
				}
				if (Convert.ToInt64 (this.tbAge.Text.ToString ()) >= ((long) 0))
				{
					goto L_0095;
				}
                DialogResult theDialogResult3 = MessageBox.Show("Ngày sinh không hợp lệ!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_0095:
				
				{
				}
				if (this.cbChucVu.Text != "")
				{
					goto L_00C3;
				}
                DialogResult theDialogResult4 = MessageBox.Show("Vui lòng chọn chức vụ!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_00C3:
				
				{
				}
				if (this.tbChuyenMon.Text != "")
				{
					goto L_00F1;
				}
                DialogResult theDialogResult5 = MessageBox.Show("Vui lòng nhập chuyên môn!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_00F1:
				
				{
				}
				if (this.tbAddress.Text != "")
				{
					goto L_011F;
				}
                DialogResult theDialogResult6 = MessageBox.Show("Vui lòng nhập địa chỉ!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0123;
				
			L_011F:
				
				{
				}
				theBoolean = true;
				goto L_0123;
				
			L_0123:
				
				{
				}
				return theBoolean;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void dtpBirthDay_Leave (object sender, EventArgs e)
			
			{
				int i;
				DateTime theDateTime;
				DateTime theDateTime2;
				this.dtpBirthDay.CustomFormat = "MM/dd/yyyy";
				this.tbAge.Text = (i = (Convert.ToInt32 ((theDateTime2 = DateTime.Now).Year) - Convert.ToInt32 ((theDateTime = DateTime.Parse (this.dtpBirthDay.Text)).Year))).ToString ();
				this.dtpBirthDay.CustomFormat = "dd/MM/yyyy";
				return;
			}
			
			private void frmThemNhanVien_Load (object sender, EventArgs e)
			
			{
				this.LoadID ();
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				object[] theObjectArray;
				Control[] theControlArray;
				theResourceManager = new ResourceManager (typeof (frmThemNhanVien));
				this.label1 = new Label ();
				this.dtpBirthDay = new DateTimePicker ();
				this.rbMale = new RadioButton ();
				this.tbPhone = new TextBox ();
				this.tbAddress = new TextBox ();
				this.tbAge = new TextBox ();
				this.tbID = new TextBox ();
				this.tbFullName = new TextBox ();
				this.label6 = new Label ();
				this.label5 = new Label ();
				this.label4 = new Label ();
				this.label3 = new Label ();
				this.label2 = new Label ();
				this.label7 = new Label ();
				this.label8 = new Label ();
				this.rbFemale = new RadioButton ();
				this.label9 = new Label ();
				this.tbChuyenMon = new TextBox ();
				this.label10 = new Label ();
				this.tbDiDong = new TextBox ();
				this.label11 = new Label ();
				this.btThem = new Button ();
				this.btThoat = new Button ();
				this.cbChucVu = new ComboBox ();
				this.tbEmail = new TextBox ();
				this.label12 = new Label ();
				base.SuspendLayout ();
				this.label1.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.ForeColor = Color.MediumBlue;
				this.label1.Location = new Point (120, 16);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (160, 23);
				this.label1.TabIndex = 0;
                this.label1.Text = "Thêm Nhân Viên";
				this.dtpBirthDay.CustomFormat = "dd/MM/yyyy";
				this.dtpBirthDay.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.dtpBirthDay.Format = DateTimePickerFormat.Custom;
				this.dtpBirthDay.Location = new Point (120, 128);
				this.dtpBirthDay.Name = "dtpBirthDay";
				this.dtpBirthDay.Size = new System.Drawing.Size (104, 23);
				this.dtpBirthDay.TabIndex = 1;
				this.dtpBirthDay.Leave += new EventHandler (this.dtpBirthDay_Leave);
				this.rbMale.Checked = true;
				this.rbMale.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.rbMale.ForeColor = SystemColors.ControlText;
				this.rbMale.Location = new Point (224, 160);
				this.rbMale.Name = "rbMale";
				this.rbMale.Size = new System.Drawing.Size (56, 24);
				this.rbMale.TabIndex = 2;
				this.rbMale.TabStop = true;
				this.rbMale.Text = "Nam";
				this.tbPhone.BorderStyle = BorderStyle.FixedSingle;
				this.tbPhone.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbPhone.Location = new Point (120, 288);
				this.tbPhone.MaxLength = 10;
				this.tbPhone.Name = "tbPhone";
				this.tbPhone.Size = new System.Drawing.Size (144, 23);
				this.tbPhone.TabIndex = 7;
				this.tbPhone.Text = "";
				this.tbPhone.KeyPress += new KeyPressEventHandler (this.tbPhone_KeyPress);
				this.tbAddress.BorderStyle = BorderStyle.FixedSingle;
				this.tbAddress.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbAddress.Location = new Point (120, 256);
				this.tbAddress.Name = "tbAddress";
				this.tbAddress.Size = new System.Drawing.Size (216, 23);
				this.tbAddress.TabIndex = 6;
				this.tbAddress.Text = "";
				this.tbAge.BorderStyle = BorderStyle.FixedSingle;
				this.tbAge.Enabled = false;
				this.tbAge.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbAge.Location = new Point (120, 160);
				this.tbAge.Name = "tbAge";
				this.tbAge.Size = new System.Drawing.Size (40, 23);
				this.tbAge.TabIndex = 80;
				this.tbAge.Text = "";
				this.tbID.BorderStyle = BorderStyle.FixedSingle;
				this.tbID.Enabled = false;
				this.tbID.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbID.Location = new Point (120, 65);
				this.tbID.Name = "tbID";
				this.tbID.Size = new System.Drawing.Size (72, 23);
				this.tbID.TabIndex = 0;
				this.tbID.Text = "";
				this.tbFullName.BorderStyle = BorderStyle.FixedSingle;
				this.tbFullName.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbFullName.Location = new Point (120, 96);
				this.tbFullName.Name = "tbFullName";
				this.tbFullName.Size = new System.Drawing.Size (216, 23);
				this.tbFullName.TabIndex = 0;
				this.tbFullName.Text = "";
				this.label6.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label6.ForeColor = SystemColors.ControlText;
				this.label6.Location = new Point (24, 288);
				this.label6.Name = "label6";
				this.label6.Size = new System.Drawing.Size (80, 23);
				this.label6.TabIndex = 22;
                this.label6.Text = "Điện thoại:";
				this.label5.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label5.ForeColor = SystemColors.ControlText;
				this.label5.Location = new Point (24, 256);
				this.label5.Name = "label5";
				this.label5.Size = new System.Drawing.Size (64, 23);
				this.label5.TabIndex = 21;
                this.label5.Text = "Địa chỉ:";
				this.label4.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label4.ForeColor = SystemColors.ControlText;
				this.label4.Location = new Point (24, 160);
				this.label4.Name = "label4";
				this.label4.Size = new System.Drawing.Size (48, 23);
				this.label4.TabIndex = 20;
                this.label4.Text = "Tuổi:";
				this.label3.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label3.ForeColor = SystemColors.ControlText;
				this.label3.Location = new Point (24, 128);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (80, 23);
				this.label3.TabIndex = 19;
                this.label3.Text = "Ngày sinh:";
				this.label2.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label2.ForeColor = SystemColors.ControlText;
				this.label2.Location = new Point (24, 96);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (80, 23);
				this.label2.TabIndex = 18;
                this.label2.Text = "Họ và tên:";
				this.label7.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label7.ForeColor = SystemColors.ControlText;
				this.label7.Location = new Point (24, 65);
				this.label7.Name = "label7";
				this.label7.Size = new System.Drawing.Size (56, 23);
				this.label7.TabIndex = 17;
                this.label7.Text = "Số ID:";
				this.label8.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label8.ForeColor = SystemColors.ControlText;
				this.label8.Location = new Point (168, 161);
				this.label8.Name = "label8";
				this.label8.TabIndex = 30;
				this.label8.Text = "Phái:";
				this.rbFemale.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.rbFemale.ForeColor = SystemColors.ControlText;
				this.rbFemale.Location = new Point (296, 160);
				this.rbFemale.Name = "rbFemale";
				this.rbFemale.Size = new System.Drawing.Size (48, 24);
				this.rbFemale.TabIndex = 3;
				this.rbFemale.Text = "Nữ";
				this.label9.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label9.ForeColor = SystemColors.ControlText;
				this.label9.Location = new Point (24, 192);
				this.label9.Name = "label9";
				this.label9.Size = new System.Drawing.Size (80, 23);
				this.label9.TabIndex = 32;
                this.label9.Text = "Chức vụ:";
				this.tbChuyenMon.BorderStyle = BorderStyle.FixedSingle;
				this.tbChuyenMon.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbChuyenMon.Location = new Point (120, 224);
				this.tbChuyenMon.Name = "tbChuyenMon";
				this.tbChuyenMon.Size = new System.Drawing.Size (216, 23);
				this.tbChuyenMon.TabIndex = 5;
				this.tbChuyenMon.Text = "";
				this.label10.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label10.ForeColor = SystemColors.ControlText;
				this.label10.Location = new Point (24, 224);
				this.label10.Name = "label10";
				this.label10.Size = new System.Drawing.Size (104, 23);
				this.label10.TabIndex = 34;
                this.label10.Text = "Chuyên môn:";
				this.tbDiDong.BorderStyle = BorderStyle.FixedSingle;
				this.tbDiDong.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbDiDong.Location = new Point (120, 320);
				this.tbDiDong.MaxLength = 10;
				this.tbDiDong.Name = "tbDiDong";
				this.tbDiDong.Size = new System.Drawing.Size (144, 23);
				this.tbDiDong.TabIndex = 8;
				this.tbDiDong.Text = "";
				this.tbDiDong.KeyPress += new KeyPressEventHandler (this.tbDiDong_KeyPress);
				this.label11.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label11.ForeColor = SystemColors.ControlText;
				this.label11.Location = new Point (24, 320);
				this.label11.Name = "label11";
				this.label11.Size = new System.Drawing.Size (80, 23);
				this.label11.TabIndex = 36;
                this.label11.Text = "Di động:";
				this.btThem.FlatStyle = FlatStyle.Popup;
				this.btThem.Location = new Point (120, 384);
				this.btThem.Name = "btThem";
				this.btThem.Size = new System.Drawing.Size (64, 23);
				this.btThem.TabIndex = 10;
				this.btThem.Text = "Thêm";
				this.btThem.Click += new EventHandler (this.btThem_Click);
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Location = new Point (200, 384);
				this.btThoat.Name = "btThoat";
				this.btThoat.Size = new System.Drawing.Size (64, 23);
				this.btThoat.TabIndex = 11;
				this.btThoat.Text = "Thoát";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.cbChucVu.DropDownStyle = ComboBoxStyle.DropDownList;
				theObjectArray = new object[4];
				theObjectArray[0] = "Trưởng phòng Khám";
                theObjectArray[1] = "Bác Sĩ";
                theObjectArray[2] = "Y Tá";
                theObjectArray[3] = "Dược Sĩ";
				this.cbChucVu.Items.AddRange (theObjectArray);
				this.cbChucVu.Location = new Point (120, 192);
				this.cbChucVu.Name = "cbChucVu";
				this.cbChucVu.Size = new System.Drawing.Size (216, 24);
				this.cbChucVu.TabIndex = 4;
				this.tbEmail.BorderStyle = BorderStyle.FixedSingle;
				this.tbEmail.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbEmail.Location = new Point (120, 352);
				this.tbEmail.Name = "tbEmail";
				this.tbEmail.Size = new System.Drawing.Size (144, 23);
				this.tbEmail.TabIndex = 9;
				this.tbEmail.Text = "";
				this.label12.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label12.ForeColor = SystemColors.ControlText;
				this.label12.Location = new Point (24, 352);
				this.label12.Name = "label12";
				this.label12.Size = new System.Drawing.Size (80, 23);
				this.label12.TabIndex = 38;
				this.label12.Text = "E-Mail:";
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (358, 419);
				theControlArray = new Control[26];
				theControlArray[0] = ((Control) this.tbEmail);
				theControlArray[1] = ((Control) this.label12);
				theControlArray[2] = ((Control) this.cbChucVu);
				theControlArray[3] = ((Control) this.btThoat);
				theControlArray[4] = ((Control) this.btThem);
				theControlArray[5] = ((Control) this.tbDiDong);
				theControlArray[6] = ((Control) this.label11);
				theControlArray[7] = ((Control) this.tbChuyenMon);
				theControlArray[8] = ((Control) this.label10);
				theControlArray[9] = ((Control) this.label9);
				theControlArray[10] = ((Control) this.dtpBirthDay);
				theControlArray[11] = ((Control) this.rbMale);
				theControlArray[12] = ((Control) this.tbPhone);
				theControlArray[13] = ((Control) this.tbAddress);
				theControlArray[14] = ((Control) this.tbAge);
				theControlArray[15] = ((Control) this.tbID);
				theControlArray[16] = ((Control) this.tbFullName);
				theControlArray[17] = ((Control) this.label6);
				theControlArray[18] = ((Control) this.label5);
				theControlArray[19] = ((Control) this.label4);
				theControlArray[20] = ((Control) this.label3);
				theControlArray[21] = ((Control) this.label2);
				theControlArray[22] = ((Control) this.label7);
				theControlArray[23] = ((Control) this.label8);
				theControlArray[24] = ((Control) this.rbFemale);
				theControlArray[25] = ((Control) this.label1);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmThemNhanVien";
				base.StartPosition = FormStartPosition.CenterScreen;
                this.Text = "Thêm Nhân Viên";
				base.Load += new EventHandler (this.frmThemNhanVien_Load);
				base.ResumeLayout (false);
				return;
			}
			
			private bool IsNumber (string Number)
			
			{
				bool theBoolean;
				
			L_0000:
				try
				{
					long theLong = long.Parse (Number);
					theBoolean = true;
				}
				catch
				{
					
				L_000B:
					
					{
					}
					theBoolean = false;
				}
				
			L_0010:
				
				{
				}
				return theBoolean;
			}
			
			private void LoadID ()
			
			{
				string theString;
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				DataTable theDataTable;
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter ("SELECT * FROM Employees", theSqlConnection);
				theDataSet = new DataSet ();
				int i = theSqlDataAdapter.Fill (theDataSet, "Employees");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_0068;
				}
				
			L_0053:
				
				{
				}
				this.tbID.Text = "NV001";
				goto L_011B;
				
			L_0068:
				
				{
				}
				theDataTable = theDataSet.Tables["Employees"];
				theString = theDataTable.Rows[((int) (theDataTable.Rows.Count - 1))][1].ToString ();
				theString = Convert.ToString (((int) (Convert.ToInt32 (theString.Replace ("NV", "").ToString ()) + 1)));
				if (Convert.ToInt32 (theString) <= 0)
				{
					goto L_00E3;
				}
				if (Convert.ToInt32 (theString) > 9)
				{
					goto L_00E3;
				}
				theString = string.Concat ("00", theString);
				goto L_0103;
				
			L_00E3:
				
				{
				}
				if (Convert.ToInt32 (theString) <= 9)
				{
					goto L_0103;
				}
				if (Convert.ToInt32 (theString) > 99)
				{
					goto L_0103;
				}
				theString = string.Concat ("0", theString);
				
			L_0103:
				
				{
				}
				theString = string.Concat ("NV", theString);
				this.tbID.Text = theString;
				
			L_011B:
				
				{
				}
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				return;
			}
			
			private void tbDiDong_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				if (char.IsNumber (e.KeyChar))
				{
					goto L_001D;
				}
				if (e.KeyChar == '\u0008')
				{
					goto L_001D;
				}
				e.Handled = true;
				
			L_001D:
				return;
			}
			
			private void tbPhone_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				if (char.IsNumber (e.KeyChar))
				{
					goto L_001D;
				}
				if (e.KeyChar == '\u0008')
				{
					goto L_001D;
				}
				e.Handled = true;
				
			L_001D:
				return;
			}
			
		#endregion
	}
	
}

